use std::fmt::Write;
fn main() {
    let num = 9;
    let mut str = String::new();
    for i in 1..=num {
        for j in 1..=i {
            write!(str, "{}x{}={} ", j, i, i * j).unwrap();
            if i * j < 10 {
                str.push(' ')
            }
        }
        str.push('\n')
    }
    println!("{}", str)
}
